package cn.zt.ztzx.controller;

import cn.zt.utils.Result;
import cn.zt.ztzx.domain.DeviceGather;
import cn.zt.ztzx.domain.dto.DeviceGatherDto;
import cn.zt.ztzx.service.DeviceGatherService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin/deviceGather")
public class DeviceGatherController {
    @Autowired
    private DeviceGatherService deviceGatherService;
//    查询所有
    @GetMapping("deviceGatherListPage")
    public Result deviceGatherListPage(DeviceGatherDto deviceGatherDto){
        return deviceGatherService.deviceGatherListPage(deviceGatherDto);
    }
//    添加
    @PostMapping("deviceGatherSave")
    public Result deviceGatherSave(DeviceGather deviceGather){
        return deviceGatherService.deviceGatherSave(deviceGather);
    }
//    修改
    @PutMapping("deviceGatherUpdate")
    public Result deviceGatherUpdate(DeviceGather deviceGather){
        return deviceGatherService.deviceGatherUpdate(deviceGather);
    }
//    删除
    @DeleteMapping("deviceGatherDelete")
    public Result deviceGatherDelete(Integer id){
        return deviceGatherService.deviceGatherDelete(id);
    }
}
